define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {

    var Controller = {
        index: function () {
            // 初始化表格参数配置
            Table.api.init({
                extend: {
                    index_url: 'clubmanage/clublog/index',
                    table: 'c_club_examine',
                }
            });

            var table = $("#table");

            // 初始化表格
            table.bootstrapTable({
                url: $.fn.bootstrapTable.defaults.extend.index_url,
                pk: 'id',
                sortName: 'id',
                search: false,
                mobileResponsive: false, //是否自适应移动端
                columns: [
                    [
                 		{field: 'clubid', title: __('俱乐部ID'), operate: false},
                        {field: 'name', title: __('俱乐部名称'), operate: false},
                        {field: 'club_type', title: __('类型'), operate: false},
                        {field: 'owner', title: __('玩家游戏ID'), operate: false},
                        {field: 'nickname', title: __('玩家昵称'), operate: false},
                        {field: 'createtime', title: __('申请时间'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', options: {}},
                        {field: 'updatetime', title: __('审核时间'), formatter: Table.api.formatter.datetime, operate: false},
                        {field: 'status', title: __('审核情况'), searchList: {'1':__('已通过'), '2': __('未通过')}},
                    ]
                ]
            });

            // 为表格绑定事件
            Table.api.bindevent(table);
            
        },
        add: function () {
            Controller.api.bindevent();
        },
        edit: function () {
            Controller.api.bindevent();
        },
        api: {
            bindevent: function () {
                Form.api.bindevent($("form[role=form]"));
            }
        }
    };
    return Controller;
});